//
//  GBNetWorking.h
//  Group8快医
//
//  Created by 密坚 on 16/3/17.
//  Copyright © 2016年 xy. All rights reserved.
//


#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>
#import "MCAPI.h"
#import "MCNetTool.h"
#if BaseClass ==0

#import "NSString+Json.h"
#import "NSString+URL.h"
#import "NSError+YU.h"

#endif


///引擎
#define ENGINE (GBNetWorking*)[GBNetWorking sharedNetworkTool]
@interface GBNetWorking : NSObject//AFHTTPSessionManager

@property(nonatomic,strong) MCNetTool *netTool;

+ (instancetype)sharedNetworkTool;

//停止监听
//-(BOOL)onStopNetworkMonitor;

//判断网络状态
-(BOOL)connectedToNetwork;

//+(NSString *)MD5ForText:(NSString *)text;

- (void)POSTNoToKen:(NSString *)url
       param:(id)param
successBlock:(successBlock)successBlcok
  falieBlock:(failedBlock)failedBlcok
  errorBlock:(errorBlock)errorBlcok;


- (void)POST:(NSString *)url
       param:(id)param
       read:(BOOL)read
     cache:(BOOL)cache
  parseClass:(Class)aClass
successBlock:(successBlock)successBlcok
  falieBlock:(failedBlock)failedBlcok
  errorBlock:(errorBlock)errorBlcok;

- (void)POST:(NSString *)url
       param:(id)param
  parseClass:(Class)aClass
successBlock:(successBlock)successBlcok
  falieBlock:(failedBlock)failedBlcok
  errorBlock:(errorBlock)errorBlcok;


- (void)GET:(NSString *)url
       param:(id)param
  parseClass:(Class)aClass
successBlock:(successBlock)successBlcok
  falieBlock:(failedBlock)failedBlcok
  errorBlock:(errorBlock)errorBlcok;


-(void)cancelRequest:(NSString *)key;

@end
